#include "gpio.h"
#include "main.h"
#include "mode.h"

void Mode1(void)
{
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	HAL_Delay(100);
	LED2_L;
	HAL_Delay(100);
	LED3_L;
	HAL_Delay(100);
	LED4_L;
	HAL_Delay(100);
	LED5_L;
	HAL_Delay(100);
	LED6_L;
	HAL_Delay(100);
	LED7_L;
	HAL_Delay(100);
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	HAL_Delay(100);
	LED2_H;
	HAL_Delay(100);
	LED3_H;
	HAL_Delay(100);
	LED4_H;
	HAL_Delay(100);
	LED5_H;
	HAL_Delay(100);
	LED6_H;
	HAL_Delay(100);
	LED7_H;
	HAL_Delay(100);
	LED8_H;
	HAL_Delay(100);

	LED8_L;
	HAL_Delay(100);
	LED7_L;
	HAL_Delay(100);
	LED6_L;
	HAL_Delay(100);
	LED5_L;
	HAL_Delay(100);
	LED4_L;
	HAL_Delay(100);
	LED3_L;
	HAL_Delay(100);
	LED2_L;
	HAL_Delay(100);
	LED1_L;
	HAL_Delay(100);
	LED8_H;
	HAL_Delay(100);
	LED7_H;
	HAL_Delay(100);
	LED6_H;
	HAL_Delay(100);
	LED5_H;
	HAL_Delay(100);
	LED4_H;
	HAL_Delay(100);
	LED3_H;
	HAL_Delay(100);
	LED2_H;
	HAL_Delay(100);
	LED1_H;
	HAL_Delay(100);

	//		LED1_L;
}
void Mode2(void)
{
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);

	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);

	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);

	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_L;
	LED3_L;
	LED6_L;
	LED7_L;
	HAL_Delay(100);
	LED1_L;
	LED4_L;
	LED5_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED4_H;
	LED5_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED3_H;
	LED6_H;
	LED7_H;
	HAL_Delay(100);

	//	  LED2_L;
}
void Mode3(void)
{
	LED1_L;
	LED2_L;
	LED3_L;
	LED4_L;
	LED5_L;
	LED6_L;
	LED7_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED2_L;
	LED3_L;
	LED4_L;
	LED5_L;
	LED6_L;
	LED7_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED2_L;
	LED3_L;
	LED4_L;
	LED5_L;
	LED6_L;
	LED7_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);

	LED1_L;
	LED3_L;
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	LED6_H;
	LED8_H;
	HAL_Delay(100);

	LED1_L;
	LED5_L;
	HAL_Delay(100);
	LED1_H;
	LED5_H;
	HAL_Delay(100);
	LED2_L;
	LED6_L;
	HAL_Delay(100);
	LED2_H;
	LED6_H;
	HAL_Delay(100);
	LED3_L;
	LED7_L;
	HAL_Delay(100);
	LED3_H;
	LED7_H;
	HAL_Delay(100);
	LED4_L;
	LED8_L;
	HAL_Delay(100);
	LED4_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED5_L;
	HAL_Delay(100);
	LED1_H;
	LED5_H;
	HAL_Delay(100);
	LED2_L;
	LED6_L;
	HAL_Delay(100);
	LED2_H;
	LED6_H;
	HAL_Delay(100);
	LED3_L;
	LED7_L;
	HAL_Delay(100);
	LED3_H;
	LED7_H;
	HAL_Delay(100);
	LED4_L;
	LED8_L;
	HAL_Delay(100);
	LED4_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED5_L;
	HAL_Delay(100);
	LED1_H;
	LED5_H;
	HAL_Delay(100);
	LED2_L;
	LED6_L;
	HAL_Delay(100);
	LED2_H;
	LED6_H;
	HAL_Delay(100);
	LED3_L;
	LED7_L;
	HAL_Delay(100);
	LED3_H;
	LED7_H;
	HAL_Delay(100);
	LED4_L;
	LED8_L;
	HAL_Delay(100);
	LED4_H;
	LED8_H;
	HAL_Delay(100);

	//    LED3_L ;
}
void Mode4(void)
{
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);

	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);

	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED1_L;
	LED8_L;
	HAL_Delay(100);
	LED2_L;
	LED7_L;
	HAL_Delay(100);
	LED3_L;
	LED6_L;
	HAL_Delay(100);
	LED4_L;
	LED5_L HAL_Delay(100);
	LED4_H;
	LED5_H HAL_Delay(100);
	LED3_H;
	LED6_H;
	HAL_Delay(100);
	LED2_H;
	LED7_H;
	HAL_Delay(100);
	LED1_H;
	LED8_H;
	HAL_Delay(100);

	//		LED4_L;
}
void Mode5(void)
{
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);

	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);

	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);

	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED6_L;
	LED8_L;
	HAL_Delay(100);
	LED5_L;
	LED7_L;
	HAL_Delay(100);
	LED2_L;
	LED4_L;
	HAL_Delay(100);
	LED1_L;
	LED3_L;
	HAL_Delay(100);
	LED1_H;
	LED3_H;
	HAL_Delay(100);
	LED2_H;
	LED4_H;
	HAL_Delay(100);
	LED5_H;
	LED7_H;
	HAL_Delay(100);
	LED6_H;
	LED8_H;
	HAL_Delay(100);
}

void Mode6(void)
{
	LED1_L;
	HAL_Delay(50);
	LED1_H;
	LED2_L;
	HAL_Delay(50);
	LED2_H;
	LED3_L;
	HAL_Delay(50);
	LED3_H;
	LED4_L;
	HAL_Delay(50);
	LED4_H;
	LED5_L;
	HAL_Delay(50);
	LED5_H;
	LED6_L;
	HAL_Delay(50);
	LED6_H;
	LED7_L;
	HAL_Delay(50);
	LED7_H;
	LED8_L;
	HAL_Delay(50);
	LED8_H;
}

void Mode7(void)
{
	HAL_GPIO_TogglePin(LED_1_GPIO_Port, LED_1_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_2_GPIO_Port, LED_2_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_3_GPIO_Port, LED_3_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_4_GPIO_Port, LED_4_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_5_GPIO_Port, LED_5_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_6_GPIO_Port, LED_6_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_7_GPIO_Port, LED_7_Pin);
	HAL_Delay(100);
	HAL_GPIO_TogglePin(LED_8_GPIO_Port, LED_8_Pin);
	HAL_Delay(100);
	LED1_H;
	LED2_H;
	LED3_H;
	LED4_H;
	LED5_H;
	LED6_H;
	LED7_H;
	LED8_H;
	HAL_GPIO_TogglePin(LS1_GPIO_Port, LS1_Pin);
	HAL_Delay(10);
	HAL_GPIO_TogglePin(LS1_GPIO_Port, LS1_Pin);
	HAL_Delay(10);
}
